package com.jlboot.core.exception;

import com.jlboot.core.base.BaseException;
import lombok.Data;

/**
 * 逻辑异常，抛出该异常,应用会拦截，并向前端展示返回该异常信息
 */
@Data
public class JlLogicException extends BaseException {

    public JlLogicException(String msg){
        this.msg=msg;
    }

    public JlLogicException(Integer code, String msg){
        this.code=code;
        this.msg=msg;
    }

    public JlLogicException(Integer code, String msg, Object data){
        this.code=code;
        this.msg=msg;
        this.data=data;
    }

    public String toString(){
        return String.format("code:%s,msg:%s,data:%s",code,msg, data.toString());
    }

}
